<template>
	<view>
		<!-- <view class="iint">
			<view class="int">
				<view class="int-title">
					<image class="search" src="../../static/images/Search.png"></image>
				</view>
				<view class="empty"></view>
				<input type="number" v-model="userNum" placeholder=" 请输入姓名 / 学号" maxlength="12" /><text
					class="sousuo">搜索</text>
			</view>
		</view> -->

		<view class="stulist" v-for="(item , index) in AllStudetnList" :key="index">
			<view class="stu-list">
				<view class="stu"><text class="sname">姓 名 : {{item.sName}}</text><text class="sid">学 号:{{item.sId}}</text></view>
				<view class="button">
					<button class="accept" @click="accept(item.sId)">通 过</button>
					<button class="refuse" @click="refuse(item.sId)">驳 回</button>
				</view>
			</view>
		</view>
		<view class="tips" v-show="tishi"><text>--- 已经到底啦 ---</text></view>
	</view>
</template>

<script>
	export default {
		data() {

			return {
				tishi: false,
				AllStudetnList: []
			}
		},
		onLoad() {
			this.findAllStu()
		},
		methods: {
			async findAllStu() {
				console.log("获取数据") /*获取到学生的相关信息*/
				const res = await this.$myRequest({
					url: "/student/findAllStudentRegisterInfo"
				})
				console.log(res)
				this.AllStudetnList = res.data.data
			},
			async accept(sId) {
				const res = await this.$myRequest({
					url: '/student/updateOrDeleteStudentStatus',
					data: {
             sId,
             sStatus:1
					},
					method: 'POST',
				}).then(res =>{
						this.AllStudetnList = res.data.data
						location.reload()
				})
			},
			async refuse(sId) {
				const res = await this.$myRequest({
					url: '/student/updateOrDeleteStudentStatus',
					data: {
			       sId,
			       sStatus:0
					},
					method: 'POST',
				}).then(res =>{
						this.AllStudetnList = res.data.data
						location.reload()
				})
			}
		}
	}
</script>

<style lang="scss">
	.stulist {
		position: relative;
		// top: 148rpx;
		// margin-top: 45rpx;
	}

	// .iint {
	// 	position: fixed;
	// 	top: 80rpx;
	// 	width: 100%;
	// 	height: 200rpx;
	// 	border-bottom: #acacac solid 5rpx;
	// 	background-color: #fafafa;
	// 	display: flex;
	// 	align-items: center;
	// 	justify-content: space-around;
	// 	z-index: 999;
	// 	border-bottom-left-radius: 30rpx;
	// 	border-bottom-right-radius: 30rpx;

	// }

	// .int {
	// 	background-color: #ffffff;
	// 	width: 80%;
	// 	position: fixed;
	// 	/* margin: 50rpx 60rpx 20rpx; */
	// 	border-radius: 15rpx;
	// 	padding: 20rpx;
	// 	display: flex;
	// 	align-items: center;
	// 	border: 3rpx solid #c3c3c3;
	// 	box-shadow: darkgray 2px 2px 4px;

	// 	input {
	// 		content: '';
	// 		width: 420rpx;
	// 		height: 55rpx;
	// 		flex: 1;
	// 		font-size: 32rpx;
	// 	}
	// }

	// .sousuo {
	// 	font-size: 35rpx;
	// 	color: #353535;
	// }

	// .search {
	// 	width: 38rpx;
	// 	height: 38rpx;
	// 	display: flex;
	// }

	.empty {
		height: 35rpx;
		width: 2rpx;
		background-color: #bbbbbb;
		margin: 0 20rpx;
	}

	.list {
		margin-top: 0rpx;
		position: fixed;
	}

	.bright {
		height: 2rpx;
		width: 100%;
		background-color: #007AFF;
	}

	.stu {
		font-size: 28rpx;
		margin-top: 3rpx;
		margin-bottom: 10rpx;
		margin-left: -2rpx;
		width: 100%;
		height: 90rpx;
		background-color: #ffffff;
		display: flex;
		align-items: center;
		text-align: center;
		border: #b9b9b9 solid 1rpx;
		font-weight: 600;
		color: #676767;
		border-bottom: #ffffff;
		border-right: #FFFFFF;

		.sname {
			text-align: left;
			// background-color: #4CD964;
			width: 28%;
		}

	}
	.button {
		display: flex;
		padding: 20rpx 0rpx;

	}

	.accept {
		border: #029eff solid 2rpx;
		background-color: unset;
		color: #029eff ;
	}

	.refuse {
		border: #c77b00 solid 2rpx;
		background-color: unset;
		color: #c77b00 ;
	}

	.accept,
	.refuse {
		width: 200rpx;
		height: 65rpx;
	}

	button {
		color: white;
		font-size: 30rpx;
		margin-top: 10rpx;
		width: 202rpx;
		height: 80rpx;
		align-items: center;
		justify-content: space-around;
		display: flex;
		box-shadow: darkgray 1px 1px 3px;
	}

	// button:hover {
	// 	color: white;
	// 	font-size: 30rpx;
	// 	margin-top: 10rpx;
	// 	width: 202rpx;
	// 	height: 80rpx;
	// 	align-items: center;
	// 	justify-content: space-around;
	// 	display: flex;

	// }

	text {
		margin-left: 109rpx;
	}

	.bright-2 {
		margin-top: 20rpx;
		margin-left: 7%;
		height: 2rpx;
		width: 86%;
		background-color: #bbbbbb;
		align-items: center;
		text-align: center;
	}

	.tips {
		position: relative;
		display: flex;
		color: #b0b0b0;
		text-align: center;
		bottom: -140rpx;
		font-size: 30rpx;
		background-color: #007AFF;
	}
</style>
